<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>转账</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
</head>
<body class="bg-light">
<div class="container mt-5">
    <div class="row justify-content-center">
        <div class="col-md-6">
            <div class="card shadow">
                <div class="card-body">
                    <h2 class="card-title text-center mb-4">转账</h2>
                    {% with messages = get_flashed_messages() %}
                        {% if messages %}
                            {% for message in messages %}
                                <div class="alert alert-danger">{{ message }}</div>
                            {% endfor %}
                        {% endif %}
                    {% endwith %}
                    <div class="alert alert-info">
                        当前余额：¥ {{ "%.2f"|format(card_info.balance) }}
                    </div>
                    <form method="POST" onsubmit="return confirm('确定要进行转账操作吗？');">
                        <div class="mb-3">
                            <label for="to_card" class="form-label">转入卡号</label>
                            <input type="text" class="form-control" id="to_card" name="to_card" required>
                        </div>
                        <div class="mb-3">
                            <label for="amount" class="form-label">转账金额</label>
                            <div class="input-group">
                                <span class="input-group-text">¥</span>
                                <input type="number" step="0.01" min="0" max="{{ card_info.balance }}" class="form-control" id="amount" name="amount" required>
                            </div>
                        </div>
                        <div class="d-grid gap-2">
                            <button type="submit" class="btn btn-primary">确认转账</button>
                            <a href="{{ url_for('customer_dashboard') }}" class="btn btn-outline-secondary">返回仪表盘</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html> 